package com.jd.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author wangshuping
 * @version 1.0
 * @date 2021/11/21 15:35
 */
@FeignClient(value = "authorization-server")
public interface OAuth2FeignClient {


    /**
     * @param username  用户名
     * @param password 密码
     * @param loginType 登录类型
     * @param grantType 授权类型
     * @param basicToken 第三方客户端加密值
     * @return
     */
    @PostMapping("/oauth/token")
    ResponseEntity<JwtToken> authToken(
            @RequestParam("username") String username,
            @RequestParam("password") String password,
            @RequestParam("login_type") String loginType,
            @RequestParam("grant_type") String grantType,
            @RequestHeader("Authorization") String basicToken
    );

}
